﻿
using HighPerformanceLog.V2;
using System.Configuration;
using System.Data;
using System.IO;
using System.Windows;
using ProcessBarDemo.UpdateFramework;
using test.ViewModels;
using test.converters;
using test.Views;
using System.Diagnostics;

namespace test
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        public static MainViewModel MainViewModel { get; private set; }
        protected override void OnStartup(StartupEventArgs e)
        {
            // 设置工作目录为程序所在路径，避免开机启动时当前目录是 System32
            Directory.SetCurrentDirectory(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName));
            base.OnStartup(e);

            MainViewModel = new MainViewModel();
            Directory.CreateDirectory("log");
            HWLogger.SetLogFilepath(Path.Combine("log", $"{DateTime.Now:yyyy-MM-dd}.log"));
            
            
            

        }

    }


}
